package com.tensquare.service;

import com.tensquare.entity.Admin;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Service;

@Service
public class UserService {

    @Autowired
    BCryptPasswordEncoder bcry;

    public void add(Admin admin){
        String newPass = bcry.encode(admin.getPassword());
        admin.setPassword(newPass);
        //保存
    }

    public Admin login(String name, String password){
        Admin admin = null;
        return admin;
    }

    public Admin findLoginname(String loginname){
        Admin admin = null;
        return admin;
    }
}
